# -*- coding: utf-8 -*-
"""
@Time ： 2023/4/20 22:09
@Auth ： 叶东宇
@File ：leftReverse.py
"""
def leftReverse(lis, k):

    lis = lis[k:] + lis[:k]

    return lis

def maopao(lis, k):
    tmp = len(lis)-1
    lis = list(lis)
    for i in range(k-1,-1,-1):
        tmpk = i
        while tmpk <= tmp - 1:
            tmp1 = lis[tmpk]
            tmp2 = lis[tmpk+1]
            lis[tmpk] = tmp2
            lis[tmpk+1] = tmp1
            tmpk += 1

        tmp -= 1

    return lis


def t():
    for i in range(10,-1,-1):
        print(i)

if __name__ == "__main__":
    lis = "abcdefg"
    k = 2
    # print(leftReverse(lis, k))
    # t()
    print(maopao(lis, k))